<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import backendProject from '@/api/backend/backendProject'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'backend_project',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: false,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'modal',
    width: 600
  },
  api: backendProject.getList
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入主键"
    }
  },
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "删除时间",
    dataIndex: "deleted_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "项目名称",
    dataIndex: "name",
    formType: "input",
    search: true
  },
  {
    title: "项目简称",
    dataIndex: "short_name",
    formType: "input",
    search: true
  },
  {
    title: "风险等级",
    dataIndex: "risk_level",
    formType: "input",
    search: true
  },
  {
    title: "省市区",
    dataIndex: "area",
    formType: "input",
    search: true
  },
  {
    title: "详细地址",
    dataIndex: "address",
    formType: "input",
    search: true
  },
  {
    title: "计划开工时间",
    dataIndex: "pre_start_at",
    formType: "date",
    search: true,
    showTime: false
  },
  {
    title: "计划竣工时间",
    dataIndex: "pre_end_at",
    formType: "date",
    search: true,
    showTime: false
  },
  {
    title: "开工时间",
    dataIndex: "start_at",
    formType: "date",
    search: true,
    showTime: false
  },
  {
    title: "竣工时间",
    dataIndex: "end_at",
    formType: "date",
    search: true,
    showTime: false
  },
  {
    title: "建设单位",
    dataIndex: "construction_unit",
    formType: "input",
    search: true
  },
  {
    title: "业主单位",
    dataIndex: "owner_unit",
    formType: "input",
    search: true
  },
  {
    title: "施工单位",
    dataIndex: "contractor_unit",
    formType: "input",
    search: true
  },
  {
    title: "总包单位",
    dataIndex: "general_contractor_unit",
    formType: "input",
    search: true
  },
  {
    title: "劳务单位",
    dataIndex: "labor_unit",
    formType: "input",
    search: true
  },
  {
    title: "监理单位",
    dataIndex: "construction_control_unit",
    formType: "input",
    search: true
  },
  {
    title: "勘察单位",
    dataIndex: "exploration_unit",
    formType: "input",
    search: true
  },
  {
    title: "设计单位",
    dataIndex: "design_unit",
    formType: "input",
    search: true
  },
  {
    title: "项目面积",
    dataIndex: "project_area",
    formType: "input",
    search: true
  },
  {
    title: "投资金额",
    dataIndex: "investment",
    formType: "input",
    search: true
  },
  {
    title: "项目介绍",
    dataIndex: "desc",
    formType: "input",
    search: true
  },
  {
    title: "安全责任人",
    dataIndex: "safety_person",
    formType: "input",
    search: true
  },
  {
    title: "安全责任人电话",
    dataIndex: "safety_person_phone",
    formType: "input",
    search: true
  },
  {
    title: "宣传图",
    dataIndex: "images",
    formType: "upload",
    hide: true,
    type: "image",
    multiple: true
  },
  {
    title: "0未开始1进行中2完工3停工4违规查处5违规停改",
    dataIndex: "status",
    formType: "input",
    search: true
  },
  {
    title: "模型code",
    dataIndex: "model_code",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "公司id",
    dataIndex: "corp_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false
  },
  {
    title: "员工id",
    dataIndex: "staff_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "用户id",
    dataIndex: "user_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "上级id",
    dataIndex: "parent_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "审批id",
    dataIndex: "approval_process_id",
    formType: "input",
    search: true
  },
  {
    title: "",
    dataIndex: "longitude",
    formType: "input",
    search: true
  },
  {
    title: "",
    dataIndex: "latitude",
    formType: "input",
    search: true
  }
])
</script>
<script> export default { name: 'backend:project' } </script>